package com.xiaotu.service.banner.impl;

import com.xiaotu.dao.banner.IndexBannerMapper;
import com.xiaotu.model.IndexBannerModel;
import com.xiaotu.service.banner.IndexBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author zhangxiao
 * @create 2021-08-26 9:20
 */
@Service
@Transactional
public class IndexBannerServiceImpl implements IndexBannerService {

    @Autowired
    private IndexBannerMapper indexBannerMapper;

    @Override
    public void insert(IndexBannerModel indexBannerModel) {
        indexBannerMapper.insert(indexBannerModel);
    }

    @Override
    public void update(IndexBannerModel indexBannerModel) {
        indexBannerMapper.updateByPrimaryKey(indexBannerModel);
    }

    @Override
    public void save(IndexBannerModel indexBannerModel) {

    }

    @Override
    public void del(Integer primaryKey) {

    }

    @Override
    public IndexBannerModel selectOne(Integer primaryKey) {
        return null;
    }

    @Override
    public List<IndexBannerModel> selectList(IndexBannerModel param) {
        return null;
    }

    @Override
    public List<IndexBannerModel> selectList() {
        Example example = new Example(IndexBannerModel.class);
        example.orderBy("orderNum").asc();
        return indexBannerMapper.selectByExample(example);
    }
}
